<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>角色列表</title>


    <!--STYLESHEET-->
    <!--=================================================--> 

    <!--Open Sans Font [ OPTIONAL ]-->
    <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700' rel='stylesheet' type='text/css'>


    <!--Bootstrap Stylesheet [ REQUIRED ]-->
    <link href="__STATIC__/css/bootstrap.min.css" rel="stylesheet">


    <!--Nifty Stylesheet [ REQUIRED ]-->
    <link href="__STATIC__/css/nifty.min.css" rel="stylesheet">


    <!--Nifty Premium Icon [ DEMONSTRATION ]-->
    <link href="__STATIC__/css/demo/nifty-demo-icons.min.css" rel="stylesheet">


    <!--Demo [ DEMONSTRATION ]-->
    <link href="__STATIC__/css/demo/nifty-demo.min.css" rel="stylesheet">

    <link href="__STATIC__/plugins/ionicons/css/ionicons.min.css" rel="stylesheet">

        
    <!--Morris.js [ OPTIONAL ]-->
    <link href="__STATIC__/plugins/morris-js/morris.min.css" rel="stylesheet">


    <!--Magic Checkbox [ OPTIONAL ]-->
    <link href="__STATIC__/plugins/magic-check/css/magic-check.min.css" rel="stylesheet">

    <link href="__STATIC__/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet">





    
    <!--JAVASCRIPT-->
    <!--=================================================-->

    <!--Pace - Page Load Progress Par [OPTIONAL]-->
    <link href="__STATIC__/plugins/pace/pace.min.css" rel="stylesheet">
    <script src="__STATIC__/plugins/pace/pace.min.js"></script>


    <!--jQuery [ REQUIRED ]-->
    <script src="__STATIC__/js/jquery-2.2.4.min.js"></script>


    <!--BootstrapJS [ RECOMMENDED ]-->
    <script src="__STATIC__/js/bootstrap.min.js"></script>


    <!--NiftyJS [ RECOMMENDED ]-->
    <script src="__STATIC__/js/nifty.min.js"></script>






    <!--=================================================-->
    
    <!--Demo script [ DEMONSTRATION ]-->
    <script src="__STATIC__/js/demo/nifty-demo.min.js"></script>

    
    <!--Morris.js [ OPTIONAL ]-->
    <script src="__STATIC__/plugins/morris-js/morris.min.js"></script>
    <script src="__STATIC__/plugins/morris-js/raphael-js/raphael.min.js"></script>


    <!--Sparkline [ OPTIONAL ]-->
    <script src="__STATIC__/plugins/sparkline/jquery.sparkline.min.js"></script>


    <!--Specify page [ SAMPLE ]-->
    <script src="__STATIC__/js/demo/dashboard.js"></script>

</head>

<!--TIPS-->
<!--You may remove all ID or Class names which contain "demo-", they are only used for demonstration. -->
<body>
   
        <div class="boxed">

            <!--CONTENT CONTAINER-->
            <!--===================================================-->
            <div id="content-container">
                
 
                <div id="page-title">
                    
                </div>
                <div class="ibox-title">
                        <h5>分配权限</h5>
                </div>

                <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
                <!--End breadcrumb-->

                <div class="panel">
                    <h1 class="text-center"><span style="color:pink;margin-bottom: 10px;border:3px solid yellow;border-radius: 5px;">{$group_data['title']}</span></h1>
                    <form action="" method="post">
                        <input type="hidden" name="id" value="{$group_data['id']}">
                        <table class="table table-striped table-bordered table-hover table-condensed
                        ">
                            {foreach name="rule_data" id="v"}
                                {empty name="v['_data']"}
                                    <tr class="b-group">
                                        <th width="10%">
                                            <label>
                                                {$v['title']}
                                                <input type="checkbox" name="rule_ids[]" value="{$v['id']}" {if condition="in_array($v['id'],$group_data['rules'])"}    checked="checked"{/if} onclick="checkAll(this)" >
                                            </label>
                                        </th>
                                        <td></td>
                                    </tr>
                                {else /}
                                    <tr class="b-group">
                                        <th width="10%">
                                            <label>
                                                {$v['title']} <input type="checkbox" name="rule_ids[]" value="{$v['id']}" {if condition="in_array($v['id'],$group_data['rules'])"}  checked="checked"{/if} onclick="checkAll(this)">
                                            </label>
                                        </th>
                                        <td class="b-child">
                                            {foreach name="v['_data']" id="n"}
                                                <table class="table table-striped table-bordered table-hover table-condensed">
                                                    <tr class="b-group">
                                                        <th width="10%">
                                                            <label>
                                                                {$n['title']} <input type="checkbox" name="rule_ids[]" value="{$n['id']}" {if condition="in_array($n['id'],$group_data['rules'])"}  checked="checked"{/if} onclick="checkAll(this)">
                                                            </label>
                                                        </th>
                                                        <td>
                                                            {notempty name="n['_data']"}
                                                                {volist name="n['_data']" id="c"}
                                                                    <label>
                                                                        &emsp;{$c['title']} <input type="checkbox" name="rule_ids[]" value="{$c['id']}" {if condition="in_array($c['id'],$group_data['rules'])"}    checked="checked"{/if} >
                                                                    </label>
                                                                {/volist}                           
                                                            {/notempty}
                                                        </td>
                                                    </tr>
                                                </table>
                                            {/foreach}
                                        </td>
                                    </tr>
                                {/empty}
                            {/foreach}
                            <tr>
                                <td colspan="2" style="text-align: center;">
                                    <!-- <input class="btn btn-success" type="submit" value="提交"> -->
                                    <button class="btn btn-lg btn-success btn-hover-success btn-rounded" type="submit">修改权限</button>
                                </td>
                            </tr>
                        </table>
                    </form>
                </div>
            </div>
            <!--===================================================-->
            <!--END CONTENT CONTAINER-->


            
            <!--ASIDE-->
            <!--===================================================-->
            <!--===================================================-->
            <!--END ASIDE-->

            
            <!--MAIN NAVIGATION-->
            <!--===================================================-->
            <nav id="mainnav-container">
                <div id="mainnav">

                    <!--Menu-->
                    <!--================================-->
                    <div id="mainnav-menu-wrap">
                        <div class="nano">
                            <div class="nano-content">

                                <!--Profile Widget-->
                                <!--================================-->
                                <div id="mainnav-profile" class="mainnav-profile">
                                    <div class="profile-wrap">
                                        <div class="pad-btm">
                                            <span class="label label-success pull-right">New</span>
                                            <img class="img-circle img-sm img-border" src="__STATIC__/img/profile-photos/1.png" alt="Profile Picture">
                                        </div>
                                        <a href="#profile-nav" class="box-block" data-toggle="collapse" aria-expanded="false">
                                            <span class="pull-right dropdown-toggle">
                                                <i class="dropdown-caret"></i>
                                            </span>
                                            <p class="mnp-name">Aaron Chavez</p>
                                            <span class="mnp-desc">aaron.cha@themeon.net</span>
                                        </a>
                                    </div>
                                    <div id="profile-nav" class="collapse list-group bg-trans">
                                        <a href="#" class="list-group-item">
                                            <i class="demo-pli-male icon-lg icon-fw"></i> View Profile
                                        </a>
                                        <a href="#" class="list-group-item">
                                            <i class="demo-pli-gear icon-lg icon-fw"></i> Settings
                                        </a>
                                        <a href="#" class="list-group-item">
                                            <i class="demo-pli-information icon-lg icon-fw"></i> Help
                                        </a>
                                        <a href="#" class="list-group-item">
                                            <i class="demo-pli-unlock icon-lg icon-fw"></i> Logout
                                        </a>
                                    </div>
                                </div>


                                <!--Shortcut buttons-->
                                <!--================================-->
                                <div id="mainnav-shortcut">
                                    <ul class="list-unstyled">
                                        <li class="col-xs-3" data-content="My Profile">
                                            <a class="shortcut-grid" href="#">
                                                <i class="demo-psi-male"></i>
                                            </a>
                                        </li>
                                        <li class="col-xs-3" data-content="Messages">
                                            <a class="shortcut-grid" href="#">
                                                <i class="demo-psi-speech-bubble-3"></i>
                                            </a>
                                        </li>
                                        <li class="col-xs-3" data-content="Activity">
                                            <a class="shortcut-grid" href="#">
                                                <i class="demo-psi-thunder"></i>
                                            </a>
                                        </li>
                                        <li class="col-xs-3" data-content="Lock Screen">
                                            <a class="shortcut-grid" href="#">
                                                <i class="demo-psi-lock-2"></i>
                                            </a>
                                        </li>
                                    </ul>
                                </div>
                                <!--================================-->
                                <!--End shortcut buttons-->


                                <ul id="mainnav-menu" class="list-group">
                        
                                    <!--Category name-->
                                    <li class="list-header">Navigation</li>
                        
                                    <!--Menu list item-->
                                    <li class="active-link">
                                        <a href="{:url('Admin/Index/index')}">
                                            <i class="demo-psi-home"></i>
                                            <span class="menu-title">
                                                <strong>控制台</strong>
                                            </span>
                                        </a>
                                    </li>
                        
                                    <!--Menu list item-->
                                    <li>
                                        <a href="#">
                                            <i class="demo-psi-split-vertical-2"></i>
                                            <span class="menu-title">
                                                <strong>管理设置</strong>
                                            </span>
                                            <i class="arrow"></i>
                                        </a>
                        
                                        <!--Submenu-->
                                        <ul class="collapse">
                                            <li><a href="{:url('Admin/User/my_center')}">个人中心</a></li>
                                        </ul>
                                    </li>

                                    <!--Menu list item-->
                                    <li>
                                        <a href="#">
                                            <i class="demo-psi-gear-2"></i>
                                            <span class="menu-title">
                                                <strong>权限控制</strong>
                                                <!-- <span class="pull-right badge badge-warning">24</span> -->
                                            </span>
                                             <i class="arrow"></i>
                                        </a>

                                        <ul class="collapse">
                                            <li><a href="{:url('Admin/Rule/rule_list')}">权限管理</a></li>
                                            <li><a href="{:url('Admin/Rule/rule_group')}">角色管理</a></li>
                                            <li><a href="{:url('Admin/User/index')}">用户管理</a></li>
                                        </ul>
                                    </li>

                                    <li>
                                        <a href="#">
                                            <i class="fa fa-cog"></i>
                                            <span class="menu-title">
                                                <strong>系统设置</strong>
                                                <!-- <span class="pull-right badge badge-warning">24</span> -->
                                            </span>
                                             <i class="arrow"></i>
                                        </a>

                                        <ul class="collapse">
                                            <li><a href="{:url('Admin/Article/index')}">文章管理</a></li>
                                            <li><a href="{:url('Admin/Rule/nav')}">菜单管理</a></li>
                                            <li><a href="{:url('Admin/Rule/log')}">日志管理</a></li>
                                        </ul>
                                    </li>
                                </ul>

                                <!--Widget-->
                                <!--================================-->
                                <div class="mainnav-widget">

                                    <!-- Show the button on collapsed navigation -->
                                    <div class="show-small">
                                        <a href="#" data-toggle="menu-widget" data-target="#demo-wg-server">
                                            <i class="demo-pli-monitor-2"></i>
                                        </a>
                                    </div>

                                    <!-- Hide the content on collapsed navigation -->
                                    <div id="demo-wg-server" class="hide-small mainnav-widget-content">
                                        <ul class="list-group">
                                            <li class="list-header pad-no pad-ver">Server Status</li>
                                            <li class="mar-btm">
                                                <span class="label label-primary pull-right">15%</span>
                                                <p>CPU Usage</p>
                                                <div class="progress progress-sm">
                                                    <div class="progress-bar progress-bar-primary" style="width: 15%;">
                                                        <span class="sr-only">15%</span>
                                                    </div>
                                                </div>
                                            </li>
                                            <li class="mar-btm">
                                                <span class="label label-purple pull-right">75%</span>
                                                <p>Bandwidth</p>
                                                <div class="progress progress-sm">
                                                    <div class="progress-bar progress-bar-purple" style="width: 75%;">
                                                        <span class="sr-only">75%</span>
                                                    </div>
                                                </div>
                                            </li>
                                            <li class="pad-ver"><a href="#" class="btn btn-success btn-bock">View Details</a></li>
                                        </ul>
                                    </div>
                                </div>
                                <!--================================-->
                                <!--End widget-->

                            </div>
                        </div>
                    </div>
                    <!--================================-->
                    <!--End menu-->

                </div>
            </nav>
            <!--===================================================-->
            <!--END MAIN NAVIGATION-->

        </div>

        

        <!-- FOOTER -->
        <!--===================================================-->
      
        <!--===================================================-->
        <!-- END FOOTER -->


        <!-- SCROLL PAGE BUTTON -->
        <!--===================================================-->
        <button class="scroll-top btn">
            <i class="pci-chevron chevron-up"></i>
        </button>
        <!--===================================================-->



    </div>
    <!--===================================================-->
    <!-- END OF CONTAINER -->


    
        <!-- SETTINGS - DEMO PURPOSE ONLY -->
    <!--===================================================-->
    
    <!--===================================================-->
    <!-- END SETTINGS -->

    <script>
        function checkAll(obj){
            $(obj).parents('.b-group').eq(0).find("input[type='checkbox']").prop('checked', $(obj).prop('checked'));
        }
    </script>

</body>
</html>
